package com.css.fxfzxczh.modules.buildingKilometerGrid.strategy;

import com.css.fxfzxczh.modules.buildingKilometerGrid.exceptions.StrategyFactoryException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class StrategyFactory1 {
    @Autowired
    Map<String, ShpService> shpServiceMap;

    public ShpService getShpService(String component) throws StrategyFactoryException {
        ShpService shpService = shpServiceMap.get(component);
        if (shpService == null) {
            throw new StrategyFactoryException("策略模式没找到对应实现类");
        }
        return shpService;
    }

}
